package com.ruoyi.appraisal.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.appraisal.mapper.HouseAppraisalMapper;
import com.ruoyi.appraisal.domain.HouseAppraisal;
import com.ruoyi.appraisal.service.IHouseAppraisalService;

/**
 * 房屋估价Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-11-09
 */
@Service
public class HouseAppraisalServiceImpl implements IHouseAppraisalService 
{
    @Autowired
    private HouseAppraisalMapper houseAppraisalMapper;

    /**
     * 查询房屋估价
     * 
     * @param id 房屋估价主键
     * @return 房屋估价
     */
    @Override
    public HouseAppraisal selectHouseAppraisalById(Long id)
    {
        return houseAppraisalMapper.selectHouseAppraisalById(id);
    }

    /**
     * 查询房屋估价列表
     * 
     * @param houseAppraisal 房屋估价
     * @return 房屋估价
     */
    @Override
    public List<HouseAppraisal> selectHouseAppraisalList(HouseAppraisal houseAppraisal)
    {
        return houseAppraisalMapper.selectHouseAppraisalList(houseAppraisal);
    }

    /**
     * 新增房屋估价
     * 
     * @param houseAppraisal 房屋估价
     * @return 结果
     */
    @Override
    public int insertHouseAppraisal(HouseAppraisal houseAppraisal)
    {
        houseAppraisal.setCreateTime(DateUtils.getNowDate());
        return houseAppraisalMapper.insertHouseAppraisal(houseAppraisal);
    }

    /**
     * 修改房屋估价
     * 
     * @param houseAppraisal 房屋估价
     * @return 结果
     */
    @Override
    public int updateHouseAppraisal(HouseAppraisal houseAppraisal)
    {
        return houseAppraisalMapper.updateHouseAppraisal(houseAppraisal);
    }

    /**
     * 批量删除房屋估价
     * 
     * @param ids 需要删除的房屋估价主键
     * @return 结果
     */
    @Override
    public int deleteHouseAppraisalByIds(Long[] ids)
    {
        return houseAppraisalMapper.deleteHouseAppraisalByIds(ids);
    }

    /**
     * 删除房屋估价信息
     * 
     * @param id 房屋估价主键
     * @return 结果
     */
    @Override
    public int deleteHouseAppraisalById(Long id)
    {
        return houseAppraisalMapper.deleteHouseAppraisalById(id);
    }
}
